// Capitalist City - Business Simulation Game
// Copyright (C) 2011 Azlan Mukhtar
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

#include "citysimulation.h"

CitySimulation::CitySimulation() : 
m_city(0)
{

}

CitySimulation::~CitySimulation()
{
    for (int i = 0; i < m_cityList.size(); i++)
    {
        delete m_cityList.at(i);
    }
}


City* CitySimulation::GetCity(int index)
{
    return m_cityList.at(index);
}

bool CitySimulation::AddCity(quint32 a_cityId, quint32 a_economyLevel, quint32 a_averageSalary, quint32 a_population, quint32 a_purchasingPower, quint32 a_spendingLevel)
{
    // temp data
    m_city = new City;
    m_city->cityId = a_cityId;   
    m_city->economyLevel = a_economyLevel;       // 1 - 100
    m_city->averageSalary = a_averageSalary;  // in cents
    m_city->population = a_population;
    m_city->purchasingPower = a_purchasingPower;
    m_city->spendingLevel = a_spendingLevel;
    m_cityList.append(m_city);
 
    return true;
}

void CitySimulation::SimulateCityEconomy()
{
    
}

